<?php 
	class UserModel extends Model{

		public $table = 'user';

		public function addUser(){

			$_POST['password'] = Q('password',0,'md5');
			if ($this->add()) {
				return true;
			}else{
				return false;
			}
		}


		###################登陆方法(处理数据)###############
		public function login(){
			$username = Q('username');
			$password = Q('password',0,'md5');
			$re = $this->where(array('username'=>$username,'password'=>$password))->find();
			unset($re['password']);
			if($re){
				return $re;
			}else{
				return false;
			}
		}
	}


 ?>